package example.demo.service;


import java.io.Serializable;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author xiao_rao
 * @since 2021-07-30
 */
public interface IKillGoodsService {

    /**
     * 秒杀一个
     * <p>
     * killId-seg-1 100  对应lock-key  killId-seg-1-lock
     * killId-seg-2 100  对应lock-key  killId-seg-2-lock
     * killId-seg-3 100  对应lock-key  killId-seg-3-lock
     * killId-seg-4 100  对应lock-key  killId-seg-4-lock
     */
    boolean redisSegment(Integer killId);

    /**
     * 使用redis-lua脚本
     */
    boolean redisLua(Integer killId);

    /**
     * 使用数据库进行秒杀
     */
    boolean db(Integer killId);


    boolean dbMultiTableSegment(Integer killId);

    boolean dbMultiRowsSegment(Integer killId);

    boolean dbMultiRowsSegmentTryOne(Integer killId);

    boolean dbMultiRowsSegmentTryOneCycleUse(Integer killId);

    boolean redisLock(Integer killId);

}
